<script type="text/javascript" src="./src/js/jquery.form.js"></script>
<script>
$(document).ready(function() {
	$('#ajaxuploadimg').click(function () {
		$('#uploadFile1').click();
    });
	$("#uploadFile1").change(function () { //选择文件 
        $("#myupload").ajaxSubmit({
            success: function (url) { //成功 
            	var f = url.split(';;');
    			if(f[0] == '0'){
    				alert('上传出错了,请重新上传');
    			}else{
    				$('#picurl').attr("value",f[0]);
    				$('#picshow').html('');
    				$('#picshow').html('<img width="300" src="'+f[0]+'" />');
    			}
            }
        });
    });
});
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="guide">
	<tr>
		<td>
			<span style="float: left;">后台管理中心&nbsp;&raquo;&nbsp;产品管理</span>
			<span style="float: right;">
				<a href="javascript:history.go(-1);">&lt;- 返回</a>
			</span>
		</td>
	</tr>
</table>

<form action="./?controller=productv3&action=doadd" method="post">
<input type="hidden" name="id" value="<?php echo $this->product['id'];?>" />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
	<tr class="header">
		<td colspan="11">产品信息(标*号的必填)</td>
	</tr>
	<tr>
		<td class="altbg1">名称 *</td>
		<td class="altbg2">
			<input class="input" name="name1" value="<?php echo $this->product['name'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1">上传图片 *</td>
		<td class="altbg2">
			<img id="ajaxuploadimg" src="./src/img/upload.png" />
			<input type="hidden" name="img" value="<?php echo $this->product['img']; ?>" id="picurl">
		</td>
	</tr>
	<tr>
		<td class="altbg1">预览图片</td>
		<td class="altbg2">
			<div id="picshow">
				<?php if (isset($this->product['img'])){ echo '<img width="300" src="'.DOMAIN.$this->product['img'].'" />';}?>
			</div>
		</td>
	</tr>
	<tr>
		<td class="altbg1">展示链接</td>
		<td class="altbg2">
			<input class="input" name="url" value="<?php echo $this->product['url'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1">描述</td>
		<td class="altbg2">
			<input class="input" name="remark" value="<?php echo $this->product['remark'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1">拼接地址</td>
		<td class="altbg2">
			<input class="input" name="join_url" value="<?php echo $this->product['join_url'];?>" />
		</td>
	</tr>
	<tr>
		<td class="altbg1">是否vip</td>
		<td class="altbg2">
            <label><input type="checkbox" name="is_vip" value="1" <?php echo $this->product['is_vip'] == 1 ? 'checked' : '';?> />是</label>
			<label><input type="checkbox" name="is_vip" value="0" <?php echo $this->product['is_vip'] == 0 ? 'checked' : '';?> />否</label>
		</td>
	</tr>
	<tr>
		<td class="altbg1" colspan=2 align="center">
			<input class="button" type="submit" value="确定" />
			&nbsp;
			<input class="button" type="reset" value="重置" />
		</td>
	</tr>
</table>
</form>



<div style="display:none;">
    <form id="myupload" action="./" method="post" enctype="multipart/form-data">
        <input type="file" id="uploadFile1" name="file" runat="server" />
        <input type="hidden" name="controller" value="upload" />
        <input type="hidden" name="action" value="index" />
    </form>
</div>